﻿<%@ Page Title="我的日记" Language="C#" MasterPageFile="~/Common1.Master" AutoEventWireup="true" CodeBehind="User2.aspx.cs" Inherits="loginWeb.User2" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">
    .auto-style3 {
        font-size: medium;
    }
</style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" runat="server">
    <p>
    <span class="auto-style3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [&nbsp; 查看日记 ]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 日期:</span><asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True" OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged" style="margin-left: 0px">
        <asp:ListItem>选择日期</asp:ListItem>
        <asp:ListItem>2016年12月20日</asp:ListItem>
        <asp:ListItem>2016年12月21日</asp:ListItem>
        <asp:ListItem>2016年12月22日</asp:ListItem>
        <asp:ListItem>2016年12月23日</asp:ListItem>
    </asp:DropDownList>
</p>
<p>
    &nbsp;</p>
<p>
    <asp:GridView ID="GridView1" runat="server" AllowPaging="True" AutoGenerateColumns="False" DataKeyNames="题目" DataSourceID="SqlDataSource1" Font-Size="Medium" OnSelectedIndexChanged="GridView1_SelectedIndexChanged" PageSize="5" style="margin-left: 66px; margin-top: 0px" Width="676px">
        <Columns>
            <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
            <asp:BoundField DataField="时间" HeaderText="时间" SortExpression="时间" />
            <asp:BoundField DataField="题目" HeaderText="题目" ReadOnly="True" SortExpression="题目" />
            <asp:BoundField DataField="内容" HeaderText="内容" SortExpression="内容" />
            <asp:BoundField DataField="作者" HeaderText="作者" SortExpression="作者" />
        </Columns>
    </asp:GridView>
</p>
<p>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <asp:HyperLink ID="HyperLink4" runat="server" Font-Underline="False" NavigateUrl="~/1.aspx" style="font-size: medium; color: #CC0000">写日记&gt;&gt;</asp:HyperLink>
    &nbsp;</p>
<p>
    &nbsp;<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConflictDetection="CompareAllValues" ConnectionString="<%$ ConnectionStrings:dhd2014112109ConnectionString %>" DeleteCommand="DELETE FROM [Diary] WHERE [题目] = @original_题目 AND [时间] = @original_时间 AND (([内容] = @original_内容) OR ([内容] IS NULL AND @original_内容 IS NULL)) AND (([作者] = @original_作者) OR ([作者] IS NULL AND @original_作者 IS NULL))" InsertCommand="INSERT INTO [Diary] ([时间], [题目], [内容], [作者]) VALUES (@时间, @题目, @内容, @作者)" OldValuesParameterFormatString="original_{0}" OnSelecting="SqlDataSource1_Selecting" SelectCommand="SELECT [时间], [题目], [内容], [作者] FROM [Diary] WHERE (([作者] = @作者) AND ([时间] = @时间)) ORDER BY [时间]" UpdateCommand="UPDATE [Diary] SET [时间] = @时间, [内容] = @内容, [作者] = @作者 WHERE [题目] = @original_题目 AND [时间] = @original_时间 AND (([内容] = @original_内容) OR ([内容] IS NULL AND @original_内容 IS NULL)) AND (([作者] = @original_作者) OR ([作者] IS NULL AND @original_作者 IS NULL))">
        <DeleteParameters>
            <asp:Parameter Name="original_题目" Type="String" />
            <asp:Parameter Name="original_时间" Type="String" />
            <asp:Parameter Name="original_内容" Type="String" />
            <asp:Parameter Name="original_作者" Type="String" />
        </DeleteParameters>
        <InsertParameters>
            <asp:Parameter Name="时间" Type="String" />
            <asp:Parameter Name="题目" Type="String" />
            <asp:Parameter Name="内容" Type="String" />
            <asp:Parameter Name="作者" Type="String" />
        </InsertParameters>
        <SelectParameters>
            <asp:ControlParameter ControlID="Label1" Name="作者" PropertyName="Text" Type="String" />
            <asp:ControlParameter ControlID="DropDownList1" Name="时间" PropertyName="SelectedValue" Type="String" />
        </SelectParameters>
        <UpdateParameters>
            <asp:Parameter Name="时间" Type="String" />
            <asp:Parameter Name="内容" Type="String" />
            <asp:Parameter Name="作者" Type="String" />
            <asp:Parameter Name="original_题目" Type="String" />
            <asp:Parameter Name="original_时间" Type="String" />
            <asp:Parameter Name="original_内容" Type="String" />
            <asp:Parameter Name="original_作者" Type="String" />
        </UpdateParameters>
    </asp:SqlDataSource>
    <asp:Label ID="Label1" runat="server" Visible="False"></asp:Label>
&nbsp;</p>
<p>
    &nbsp;</p>
<p>
    &nbsp;</p>
<p>
    &nbsp;</p>
<p>
    &nbsp;</p>
<p>
    &nbsp;</p>
<p>
    &nbsp;</p>
<p>
    &nbsp;</p>
</asp:Content>
